package com.csl.xm.demo.base.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * <pre>
 * 描述：基础实体类
 * </pre>
 *
 * @类名：com.csl.xm.demo.base.entity.BaseEntity
 * @作者： 1410HL0236
 * @创建日期: 2019/11/20 13:15
 */
@MappedSuperclass
public class BaseEntity {
  @Id
  @GenericGenerator(name = "uuid", strategy = "uuid")
  protected String id;

  @Column(name = "create_date")
  Date createDate = new Date();

  @Column(name = "update_date")
  Date updateDate = new Date();

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public Date getCreateDate() {
    return createDate;
  }

  public void setCreateDate(Date createDate) {
    this.createDate = createDate;
  }

  public Date getUpdateDate() {
    return updateDate;
  }

  public void setUpdateDate(Date updateDate) {
    this.updateDate = updateDate;
  }
}
